//
//  MCSettingSwitchTableViewCell.swift
//  MCBodyBuildingPro
//
//  Created by Renlvshijie on 2023/5/7.
//

import UIKit
import SnapKit
import QMUIKit

class MCSettingSwitchTableViewCell: UITableViewCell {
    
        
    var titleSettingLabel:QMUILabel!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        loadSubViews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func loadSubViews() -> Void {
        self.contentView.backgroundColor = UIColor.qmui_color(withHexString: "#F7F7F9")
        //包裹
        let containerView = UIView.init()
        containerView.backgroundColor = UIColor.white
        self.contentView.addSubview(containerView)
        containerView.snp.makeConstraints { make in
            make.left.equalTo(self.contentView.snp.left).offset(16)
            make.right.equalTo(self.contentView.snp.right).offset(-16)
            make.top.equalTo(self.contentView.snp.top).offset(0)
            make.bottom.equalTo(self.contentView.snp.bottom).offset(0)
            make.height.equalTo(54)
        }
        
        //title
        let titleLabel = QMUILabel.init()
        titleLabel.text = "训练提醒"
        titleLabel.textColor = UIColor.qmui_color(withHexString:"#10151C")
        titleLabel.font = UIFont(name: "PingFangSC-Regular", size: 15)
        containerView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(containerView.snp.left).offset(16)
            make.centerY.equalTo(containerView.snp.centerY).offset(0)
            make.height.equalTo(45)
        }
        
        titleSettingLabel = titleLabel
        
        //
        let enterRightSwitch = UISwitch.init()
        enterRightSwitch.isOn = true
        containerView.addSubview(enterRightSwitch)
        enterRightSwitch.snp.makeConstraints { make in
            make.right.equalTo(containerView.snp.right).offset(-16)
            make.centerY.equalTo(containerView.snp.centerY).offset(0)
        }
    }

}
